this.name        = "Pirate Cove Rock"; 
this.author      = "eric walch"; 
this.description = "Script for the Pirate_Cove Rock by Lazy Gun"; 
this.version     = "1.2"; 

// Correct clean hits.
this.shipBeingAttacked = function(attacker)
{
	// this test is depricated since 1.73: this.ship.ID == attacker.groupID
    if (attacker.owner && attacker.owner == this.ship && attacker.target && attacker.target == this.ship)
	{
		attacker.reactToAIMessage("TARGET_LOST");
		log(this.name, "Pirate cove was friendly hit by: "+ attacker.displayName)
	}
}


this.stationLaunchedShip = function(ship)
{
	//log(this.name, "Pirate Cove launched: "+ ship.displayName)
    if(ship.primaryRole == "defense_ship") ship.switchAI("pirateCovePirateAI.plist")
	if(ship.primaryRole == "scavenger"  && !ship.bounty) ship.bounty = Math.random()*30
}